<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>

<jsp:include page="../layout/topPg.jsp" />

<!-- INI mySongsPg -->
	
<table id="mySongsList">
	<tr>
		<th id="mySongsList_th_artist">
			<c:if test="${param.order != 'artist'}">
				<a href="../users/mySongs.html?order=artist&direction=asc">
			</c:if>
			<c:if test="${param.order == 'artist'}">
				<c:if test="${param.direction == 'asc'}">
					<a href="../users/mySongs.html?order=artist&direction=desc">
				</c:if>
				<c:if test="${param.direction != 'asc'}">
					<a href="../users/mySongs.html?order=artist&direction=asc">
				</c:if>
			</c:if>
				Artist
				<img class="sortImg" src="../images/tables/sort.png"/>
			</a>
		</th>
		<th id="mySongsList_th_song">
			<c:if test="${param.order != 'song'}">
				<a href="../users/mySongs.html?order=song&direction=asc">
			</c:if>
			<c:if test="${param.order == 'song'}">
				<c:if test="${param.direction == 'asc'}">
					<a href="../users/mySongs.html?order=song&direction=desc">
				</c:if>
				<c:if test="${param.direction != 'asc'}">
					<a href="../users/mySongs.html?order=song&direction=asc">
				</c:if>
			</c:if>
				Song
				<img class="sortImg" src="../images/tables/sort.png"/>
			</a>
		</th>
		<th id="mySongsList_th_tune">Tune</th>
		<th id="mySongsList_th_record">Record</th>
		<th id="mySongsList_th_cover">Cover</th>
		<c:if test="${!viewOnly}">
			<th id="mySongsList_th_actions">Actions</th>
		</c:if>
	</tr>
	<c:forEach var="userSong" items="${userSongs}" varStatus="loopCount">
	
	<c:if test="${userSong.level == null || userSong.level == 0}">
		<tr id="mySong0">
	</c:if>
	<c:if test="${userSong.level == 1}">
		<tr id="mySong1">
	</c:if>
	<c:if test="${userSong.level == 2}">
		<tr id="mySong2">
	</c:if>
	<c:if test="${userSong.level == 3}">
		<tr id="mySong3">
	</c:if>
	<c:if test="${userSong.level == 4}">
		<tr id="mySong4">
	</c:if>
	<c:if test="${userSong.level == 5}">
		<tr id="mySong5">
	</c:if>
			<td>${userSong.artist}</td>
			<td>${userSong.song}</td>
			<td>${userSong.tune}</td>
			<td>
				<c:if test="${userSong.record != '' && userSong.record != null}">
					<a href="${userSong.record}"><img class="imgTaula" src="../images/buttons/listen.png" alt="Listen"/></a>
				</c:if>
			</td>
			<td>
				<c:if test="${userSong.cover != '' && userSong.cover != null}">
					<a href="${userSong.cover}"><img class="imgTaula" src="../images/buttons/video.png" alt="Cover"/></a>
				</c:if>
			</td>
			<c:if test="${!viewOnly}">
				<td>
					<form class="imgTaula" action="../users/removeMySong.html" method="POST">
						<input type="hidden" name="id" value="${userSong.id}">
						<input class="imgTaula" type="image" src="../images/buttons/delete.png" alt="Remove" onclick="return confirm('Are you sure you want to remove your info for this song?')"/>
					</form>
					<a href="../users/editMySong${userSong.id}.html">
						<img class="imgTaula" src="../images/buttons/detail.png" alt="Edit"/>
					</a>
				</td>
			</c:if>
		</tr>
	</c:forEach>
</table>
	
<!-- FI mySongsPg -->

<jsp:include page="../layout/footerPg.jsp" />
